package com.example.appjava.dao;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author sjw
 * @className aaa
 * @date 2021/10/21 8:47
 * @description: TODO
 */
public class aaa {
    public static final String yyyMMddHHmmssSSS = "yyyy-MM-dd HH:mm:ss:SSS";
    public static final String yyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
    public static final String MMddHHmm = "MM-dd HH:mm";
    public static final String yyyyMMdd = "yyyy-MM-dd";
    public static final SimpleDateFormat sdf =   new SimpleDateFormat( yyyMMddHHmmss );
    public static void main(String[] args) throws ParseException {
        String s="2019-11-20 16:56:40";
        Date date=sdf.parse(s);
        System.out.println(1);
        Date date1=new Date();
//        System.out.println(date1);
//        date1.setYear(date.getYear());
//        date1.setMonth(0);
//        System.out.println(date1.getDate());
//        System.out.println(date1);

        if(date.getMonth()==11) {
            System.out.println("-------------");
            date1.setYear(date.getYear()+1);
            date1.setMonth(0);
        }else {
            date1.setYear(date.getYear());
            date1.setMonth(date.getMonth() + 1);
        }
        System.out.println(date1);
    }
}
